fix: TitleBar height shrinks when window width is reduced#1309
fix: TitleBar height shrinks when window width is reduced#1309
Conversation
…ler width (#1340) Co-authored-by: bdlukaa <45696119+bdlukaa@users.noreply.github.com>
|
@copilot The issue seems to happen when we hide an element of the title bar, such as the title, to make the title bar fit in the available width. |
Co-authored-by: bdlukaa <45696119+bdlukaa@users.noreply.github.com>
Exactly right — Fixed in 9363d4e: removed the Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Two root causes were identified and fixed:
TitleBarused looseBoxConstraints(minHeight: content != null ? 48 : 32,maxHeight: 48). WithCrossAxisAlignment.stretchand all-flex children, the cross-axis size was clamped tominHeightrather thanmaxHeight, making the height unpredictable._RenderTitleSubtitleOverflowreported zero height when elements were hidden. When the title or subtitle was hidden to fit a narrow window width,computeMinIntrinsicHeightandcomputeMaxIntrinsicHeightskipped hidden children (guarded by!childParentData.isHidden), returning 0. This stale state propagated up the layout tree, causing parent widgets to compute a smaller height for the TitleBar.Changes
title_bar.dart—TitleBar.build(): Replace looseBoxConstraintswithBoxConstraints.tightForso the outer height is always deterministic:content != null→ 48pxcontent == null→ 32pxtitle_bar.dart—_RenderTitleSubtitleOverflow: Remove theisHiddenguard fromcomputeMinIntrinsicHeightandcomputeMaxIntrinsicHeightso height is always computed from all children, regardless of their current visibility — consistent with_performLayout, which already measures all children for height.navigation_view_test.dart: Add regression tests verifying TitleBar height is stable at 48px (with content) and 32px (without content) across both wide and narrow window widths.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.